package com.example.administrator.managesystem.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.example.administrator.managesystem.R;
import com.example.administrator.managesystem.activity.firstpage.circle.interfaces.OnItemPictureClickListener;
import com.example.administrator.managesystem.adapter.holder.WikiHolder;
import com.example.administrator.managesystem.base.BaseAdapter;
import com.example.administrator.managesystem.base.BaseHolder;
import com.example.administrator.managesystem.bean.WikiListBean;

import java.util.List;

public class WikiAdapter extends BaseAdapter<WikiListBean.DataBean> {

    private List<WikiListBean.DataBean> list;
    private Context context;
    private final int ITEM_TEXT=0;
    private final int ITEM_EMPTY=1;
    private WikiHolder.OnItemClickListener listener;
    public WikiAdapter(Context context, List<WikiListBean.DataBean> list) {
        super(context, list);
        this.list = list;
        this.context = context;
    }

    public void addListener(WikiHolder.OnItemClickListener listen){
       listener=listen;
    }
    @Override
    public int getHolderType(int position) {
        return ITEM_TEXT;
    }



    @Override
    public BaseHolder createBaseHolder(ViewGroup parent, int viewType) {
        BaseHolder holder = null;
        switch (viewType){
            case ITEM_TEXT:
                holder = new WikiHolder(LayoutInflater.from(context).inflate(R.layout.recycler_wiki_item,parent,false),context,listener);
                break;
        }
        return holder;
    }


}
